<!DOCTYPE html>
<head>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script>
</head>
<body>
    
    <div id="app"> 
        <button v-on:click="reduce(10)">减少十岁</button>
        <button v-on:click="add(10)">增加十岁</button>
        <p>马云的年龄:{{age}}岁</p>
    </div>
    <script>    
    new Vue({
       el:'#app',
       data:{age:"50"},
    methods:{
        add:function(change){
            this.age+=change
        },
        reduce:function(change){
            this.age-=change
        }
    }
    })
</script>
</body>

</html>
